import request from '@/utils/request';
import store from '@/store'

// 列表删除接口
export function deleteCodingRule(data) {
    return request({
        url: `/maintain/maintain/codingRule/deleteCodingRule/${data}`,
        method: 'delete'
    })
}

// 新增接口
export function addCodingRule(data) {
    const params = {
        ...data,
        createUserId: store.getters.userId,
        updateUserId: store.getters.userId
    }
    return request({
        url: '/maintain/maintain/codingRule/addCodingRule',
        method: 'put',
        data: params
    })
}

// 详情接口
export function detailsList(data) {
    return request({
        url: `/maintain/maintain/codingRule/getCodingRuleInfo/${data}`,
        method: 'get',
    })
}

// 编辑接口
export function editCodingRule(data) {
    const params = {
        ...data,
        updateUserId: store.getters.userId
    }
    return request({
        url: '/maintain/maintain/codingRule/editCodingRule',
        method: 'put',
        data: params
    })
}